package com.party.core.model.charge;

import com.party.common.annotation.ExcelField;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;
import java.util.Date;

/**
 * @program: party
 * @description: 用户产品关系输出实体
 * @author: Hua Qunhao
 * @create: 2019-05-25 14:06
 **/
public class PackageMemberOutput extends PackageMemberWithAuthor {

    //订单名称
    private String orderName;
    //支付方式
    private String payWayStr;
    //支付状态
    private String payStatusStr;
    private String statusStr;

    @ExcelField(title = "订单名称", align = 2, sort = 5)
    public String getOrderName() {
        Integer systemType = this.getSystemType();
        String packagename = this.getPackageName();

        return systemType + " —— " + packagename;
    }

    public void setOrderName(String orderName) {
        this.orderName = orderName;
    }

    @ExcelField(title = "下单者", align = 2, sort = 10)
    @Override
    public String getMemberName() {
        return super.getMemberName();
    }

    @Override
    public void setMemberName(String memberName) {
        super.setMemberName(memberName);
    }

    @ExcelField(title = "金额（元）", align = 2, sort = 15)
    @Override
    public Float getPrice() {
        return super.getPrice();
    }

    @Override
    public void setPrice(Float price) {
        super.setPrice(price);
    }

    @ExcelField(title = "支付方式", align = 2, sort = 20)
    public String getPayWayStr() {
        Integer payWay = this.getPayWay();
        if (payWay == 0) {
            payWayStr = "支付宝";
        } else if (payWay == 1) {
            payWayStr = "微信";
        } else {
            payWayStr = "线下转账";
        }
        return payWayStr;
    }

    public void setPayWayStr(String payWayStr) {
        this.payWayStr = payWayStr;
    }

    @ExcelField(title = "支付状态", align = 2, sort = 25)
    public String getPayStatusStr() {
        Integer payStatus = this.getPayStatus();
        if (payStatus == 1) {
            payStatusStr = "待支付";
        } else if (payStatus == 2) {
            payStatusStr = "支付成功";
        } else {
            payStatusStr = "其他";
        }
        return payStatusStr;
    }

    public void setPayStatusStr(String payStatusStr) {
        this.payStatusStr = payStatusStr;
    }


    @Override
    public String getPackageName() {
        return super.getPackageName();
    }

    @Override
    public void setPackageName(String packageName) {
        super.setPackageName(packageName);
    }

    @Override
    public Integer getPayWay() {
        return super.getPayWay();
    }

    @Override
    public void setPayWay(Integer payWay) {
        super.setPayWay(payWay);
    }

    @Override
    public String getOrderId() {
        return super.getOrderId();
    }

    @Override
    public void setOrderId(String orderId) {
        super.setOrderId(orderId);
    }

    @Override
    public Integer getPayStatus() {
        return super.getPayStatus();
    }

    @Override
    public void setPayStatus(Integer payStatus) {
        super.setPayStatus(payStatus);
    }

    @Override
    public Integer getSmsSource() {
        return super.getSmsSource();
    }

    @Override
    public void setSmsSource(Integer smsSource) {
        super.setSmsSource(smsSource);
    }

    @Override
    public String getMemberId() {
        return super.getMemberId();
    }

    @Override
    public void setMemberId(String memberId) {
        super.setMemberId(memberId);
    }

    @Override
    public String getLevelId() {
        return super.getLevelId();
    }

    @Override
    public void setLevelId(String levelId) {
        super.setLevelId(levelId);
    }

    @Override
    public Date getStartTime() {
        return super.getStartTime();
    }

    @Override
    public void setStartTime(Date startTime) {
        super.setStartTime(startTime);
    }

    @Override
    public Date getEndTime() {
        return super.getEndTime();
    }

    @Override
    public void setEndTime(Date endTime) {
        super.setEndTime(endTime);
    }

    @Override
    public Integer getStatus() {
        return super.getStatus();
    }

    @Override
    public void setStatus(Integer status) {
        super.setStatus(status);
    }

    @Override
    public String getSysRoleId() {
        return super.getSysRoleId();
    }

    @Override
    public void setSysRoleId(String sysRoleId) {
        super.setSysRoleId(sysRoleId);
    }

    @Override
    public Integer getQuantity() {
        return super.getQuantity();
    }

    @Override
    public void setQuantity(Integer quantity) {
        super.setQuantity(quantity);
    }

    @Override
    public Integer getAuditStatus() {
        return super.getAuditStatus();
    }

    @Override
    public void setAuditStatus(Integer auditStatus) {
        super.setAuditStatus(auditStatus);
    }

    @Override
    public Integer getSystemType() {
        return super.getSystemType();
    }

    @Override
    public void setSystemType(Integer systemType) {
        super.setSystemType(systemType);
    }

    @Override
    public String toString() {
        return super.toString();
    }

    @Override
    public String getId() {
        return super.getId();
    }

    @Override
    public void setId(String id) {
        super.setId(id);
    }

    @Override
    public String getCreateBy() {
        return super.getCreateBy();
    }

    @Override
    public void setCreateBy(String createBy) {
        super.setCreateBy(createBy);
    }

    @Override
    public Date getCreateDate() {
        return super.getCreateDate();
    }

    @Override
    public void setCreateDate(Date createDate) {
        super.setCreateDate(createDate);
    }

    @Override
    public String getUpdateBy() {
        return super.getUpdateBy();
    }

    @Override
    public void setUpdateBy(String updateBy) {
        super.setUpdateBy(updateBy);
    }

    @ExcelField(title = "更新时间", align = 2, sort = 30)
    @Override
    public Date getUpdateDate() {
        return super.getUpdateDate();
    }

    @Override
    public void setUpdateDate(Date updateDate) {
        super.setUpdateDate(updateDate);
    }

    @ExcelField(title = "是否有效", align = 2, sort = 35)
    public String getStatusStr() {
        Integer status = this.getStatus();
        if (status == 1) {
            statusStr = "有效";
        } else {
            statusStr = "无效";
        }
        return statusStr;
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }

    @Override
    public String getRemarks() {
        return super.getRemarks();
    }

    @Override
    public void setRemarks(String remarks) {
        super.setRemarks(remarks);
    }

    @Override
    public String getDelFlag() {
        return super.getDelFlag();
    }

    @Override
    public void setDelFlag(String delFlag) {
        super.setDelFlag(delFlag);
    }

    @Override
    public boolean equals(Object o) {
        return super.equals(o);
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    protected void finalize() throws Throwable {
        super.finalize();
    }

    public static PackageMemberOutput transform(PackageMemberWithAuthor packageMemberWithAuthor) {
        PackageMemberOutput output = new PackageMemberOutput();
        try {
            BeanUtils.copyProperties(output, packageMemberWithAuthor);
        } catch (IllegalAccessException | InvocationTargetException e) {
            e.printStackTrace();
        }
        return output;
    }
}
